package com.yumeng.mywrite_picture_agent.tools;

import org.springframework.ai.tool.ToolCallback;
import org.springframework.ai.tool.ToolCallbacks;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

//7.注册中心工具类，实现了把六个自定义工具都告诉ai
@Configuration
public class ToolRegistration {

    @Value("${search-api.api-key}")
    private String searchApiKey;

    @Bean
    public ToolCallback[] allTools() {//这个方法就是拿到ai的所有类

        WebSearchTool webSearchTool = new WebSearchTool(searchApiKey);
        WebScrapingTool webScrapingTool = new WebScrapingTool();



        //上面就是把六个工具实例创建出来
        return ToolCallbacks.from(

            webSearchTool,
            webScrapingTool


        );
    }
}
